home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / GameCreators / Inform / library / grammar.h < prev    next >
Encoding:
Text File  |  1997-03-15  |  16.8 KB  |  388 lines

  1. ! ----------------------------------------------------------------------------
  2. !  GRAMMAR:  Grammar table entries for the standard verbs library.
  3. !
  4. !  Supplied for use with Inform 6                         Serial number 970918
  5. !                                                                  Release 6/7
  6. !  (c) Graham Nelson 1993, 1994, 1995, 1996, 1997
  7. !      but freely usable (see manuals)
  8. ! ----------------------------------------------------------------------------
  9. !  The "meta-verbs", commands to the game rather than in the game, come first:
  10. ! ----------------------------------------------------------------------------
  11.  
  12. System_file;
  13.  
  14. Verb meta 'score'
  15.                 *                                -> Score;
  16. Verb meta 'fullscore' 'full'
  17.                 *                                -> FullScore
  18.                 * 'score'                        -> FullScore;
  19. Verb meta 'q//' 'quit' 'die'
  20.                 *                                -> Quit;
  21. Verb meta 'restore'
  22.                 *                                -> Restore;
  23. Verb meta 'restart'
  24.                 *                                -> Restart;
  25. Verb meta 'verify'
  26.                 *                                -> Verify;
  27. Verb meta 'save'
  28.                 *                                -> Save;
  29. Verb meta 'script' 'transcript'
  30.                 *                                -> ScriptOn
  31.                 * 'off'                          -> ScriptOff
  32.                 * 'on'                           -> ScriptOn;
  33. Verb meta 'noscript' 'unscript'
  34.                 *                                -> ScriptOff;
  35. Verb meta 'superbrief' 'short'
  36.                 *                                -> LMode3;
  37. Verb meta 'verbose' 'long'
  38.                 *                                -> LMode2;
  39. Verb meta 'brief' 'normal'
  40.                 *                                -> LMode1;
  41. Verb meta 'pronouns' 'nouns'
  42.                 *                                -> Pronouns;
  43. Verb meta 'notify'
  44.                 * 'on'                           -> NotifyOn
  45.                 * 'off'                          -> NotifyOff;
  46. Verb meta 'version'
  47.                 *                                -> Version;
  48. #IFNDEF NO_PLACES;
  49. Verb meta 'places'
  50.                 *                                -> Places;
  51. Verb meta 'objects'
  52.                 *                                -> Objects;
  53. #ENDIF;
  54.  
  55. ! ----------------------------------------------------------------------------
  56. !  Debugging grammar
  57. ! ----------------------------------------------------------------------------
  58.  
  59. #ifdef DEBUG;
  60. Verb meta 'trace'
  61.                 *                                -> TraceOn
  62.                 * number                         -> TraceLevel
  63.                 * 'on'                           -> TraceOn
  64.                 * 'off'                          -> TraceOff;
  65. Verb meta 'actions'
  66.                 *                                -> ActionsOn
  67.                 * 'on'                           -> ActionsOn
  68.                 * 'off'                          -> ActionsOff;
  69. Verb meta 'routines' 'messages'
  70.                 *                                -> RoutinesOn
  71.                 * 'on'                           -> RoutinesOn
  72.                 * 'off'                          -> RoutinesOff;
  73. Verb meta 'timers' 'daemons'
  74.                 *                                -> TimersOn
  75.                 * 'on'                           -> TimersOn
  76.                 * 'off'                          -> TimersOff;
  77. Verb meta 'recording'
  78.                 *                                -> CommandsOn
  79.                 * 'on'                           -> CommandsOn
  80.                 * 'off'                          -> CommandsOff;
  81. Verb meta 'replay'
  82.                 *                                -> CommandsRead;
  83. Verb meta 'random'
  84.                 *                                -> Predictable;
  85. Verb meta 'purloin'
  86.                 * multi                          -> XPurloin;
  87. Verb meta 'abstract'
  88.                 * noun 'to' noun                 -> XAbstract;
  89. Verb meta 'tree'
  90.                 *                                -> XTree
  91.                 * noun                           -> XTree;
  92. Verb meta 'goto'
  93.                 * number                         -> Goto;
  94. Verb meta 'gonear'
  95.                 * noun                           -> Gonear;
  96. Verb meta 'scope'
  97.                 *                                -> Scope
  98.                 * noun                           -> Scope;
  99. Verb meta 'showverb'
  100.                 * special                        -> Showverb;
  101. Verb meta 'showobj'
  102.                 *                                -> Showobj
  103.                 * multi                          -> Showobj;
  104. #endif;
  105.  
  106. ! ----------------------------------------------------------------------------
  107. !  And now the game verbs.
  108. ! ----------------------------------------------------------------------------
  109.  
  110. Verb 'take' 'carry' 'hold'
  111.                 * multi                          -> Take
  112.                 * 'off' worn                     -> Disrobe
  113.                 * multiinside 'from' noun        -> Remove
  114.                 * multiinside 'off' noun         -> Remove
  115.                 * 'inventory'                    -> Inv;
  116. Verb 'get'      * 'out'/'off'/'up'               -> Exit
  117.                 * multi                          -> Take
  118.                 * 'in'/'into'/'on'/'onto' noun   -> Enter
  119.                 * 'off' noun                     -> GetOff
  120.                 * multiinside 'from' noun        -> Remove;
  121. Verb 'pick'
  122.                 * 'up' multi                     -> Take
  123.                 * multi 'up'                     -> Take;
  124. Verb 'stand'
  125.                 *                                -> Exit
  126.                 * 'up'                           -> Exit
  127.                 * 'on' noun                      -> Enter;
  128. Verb 'remove'
  129.                 * held                           -> Disrobe
  130.                 * multi                          -> Take
  131.                 * multiinside 'from' noun        -> Remove;
  132. Verb 'shed' 'doff' 'disrobe'
  133.                 * held                           -> Disrobe; 
  134. Verb 'wear' 'don'
  135.                 * held                           -> Wear;
  136. Verb 'put'
  137.                 * multiexcept 'in'/'inside'/'into' noun
  138.                                                  -> Insert
  139.                 * multiexcept 'on'/'onto' noun   -> PutOn
  140.                 * 'on' held                      -> Wear
  141.                 * 'down' multiheld               -> Drop
  142.                 * multiheld 'down'               -> Drop;
  143. Verb 'insert'
  144.                 * multiexcept 'in'/'into' noun   -> Insert;
  145. Verb 'empty'
  146.                 * noun                           -> Empty
  147.                 * 'out' noun                     -> Empty
  148.                 * noun 'out'                     -> Empty
  149.                 * noun 'to'/'into'/'on'/'onto' noun
  150.                                                  -> EmptyT;
  151. Verb 'transfer'
  152.                 * noun 'to' noun                 -> Transfer;
  153. Verb 'drop' 'throw' 'discard'
  154.                 * multiheld                      -> Drop
  155.                 * multiexcept 'in'/'into'/'down' noun
  156.                                                  -> Insert
  157.                 * multiexcept 'on'/'onto' noun   -> PutOn
  158.                 * held 'at'/'against'/'on'/'onto' noun
  159.                                                  -> ThrowAt;
  160. Verb 'give' 'pay' 'offer' 'feed'
  161.                 * held 'to' creature             -> Give
  162.                 * creature held                  -> Give reverse
  163.                 * 'over' held 'to' creature      -> Give;
  164. Verb 'show' 'present' 'display'
  165.                 * creature held                  -> Show reverse
  166.                 * held 'to' creature             -> Show;
  167. [ ADirection; if (noun in compass) rtrue; rfalse; ];
  168. Verb 'go' 'walk' 'run'
  169.                 *                                -> VagueGo
  170.                 * noun=ADirection                -> Go
  171.                 * noun                           -> Enter
  172.                 * 'into'/'in'/'inside'/'through' noun
  173.                                                  -> Enter;
  174. Verb 'leave'
  175.                 *                                -> VagueGo
  176.                 * noun=ADirection                -> Go
  177.                 * noun                           -> Exit
  178.                 * 'into'/'in'/'inside'/'through' noun
  179.                                                  -> Enter;
  180. Verb 'inventory' 'inv' 'i//'
  181.                 *                                -> Inv
  182.                 * 'tall'                         -> InvTall
  183.                 * 'wide'                         -> InvWide;
  184. Verb 'look' 'l//'
  185.                 *                                -> Look
  186.                 * 'at' noun                      -> Examine
  187.                 * 'inside'/'in'/'into'/'through' noun
  188.                                                  -> Search
  189.                 * 'under' noun                   -> LookUnder
  190.                 * 'up' topic 'in' noun           -> Consult;
  191. Verb 'consult'  * noun 'about' topic             -> Consult
  192.                 * noun 'on' topic                -> Consult;
  193. Verb 'open' 'unwrap' 'uncover' 'undo'
  194.                 * noun                           -> Open
  195.                 * noun 'with' held               -> Unlock;
  196. Verb 'close' 'shut' 'cover'
  197.                 * noun                           -> Close
  198.                 * 'up' noun                      -> Close
  199.                 * 'off' noun                     -> SwitchOff;
  200. Verb 'enter' 'cross'
  201.                 *                                -> GoIn
  202.                 * noun                           -> Enter;
  203. Verb 'sit' 'lie'
  204.                 * 'on' 'top' 'of' noun           -> Enter
  205.                 * 'on'/'in'/'inside' noun        -> Enter;
  206. Verb 'in' 'inside'
  207.                 *                                -> GoIn;
  208. Verb 'exit' 'out' 'outside'
  209.                 *                                -> Exit;
  210. Verb 'examine' 'x//' 'watch' 'describe' 'check'
  211.                 * noun                           -> Examine;
  212. Verb 'read'
  213.                 * noun                           -> Examine
  214.                 * 'about' topic 'in' noun        -> Consult
  215.                 * topic 'in' noun                -> Consult;
  216. Verb 'yes' 'y//'
  217.                 *                                -> Yes;
  218. Verb 'no'
  219.                 *                                -> No;
  220. Verb 'sorry'
  221.                 *                                -> Sorry;
  222. Verb 'shit' 'fuck' 'damn' 'sod'
  223.                 *                                -> Strong
  224.                 * topic                          -> Strong;
  225. Verb 'bother' 'curses' 'drat' 'darn'
  226.                 *                                -> Mild
  227.                 * topic                          -> Mild;
  228. Verb 'search'
  229.                 * noun                           -> Search;
  230. Verb 'wave'
  231.                 *                                -> WaveHands
  232.                 * noun                           -> Wave;
  233. Verb 'set' 'adjust'
  234.                 * noun                           -> Set
  235.                 * noun 'to' special              -> SetTo;
  236. Verb 'pull' 'drag'
  237.                 * noun                           -> Pull;
  238. Verb 'push' 'move' 'shift' 'clear' 'press'
  239.                 * noun                           -> Push
  240.                 * noun noun                      -> PushDir
  241.                 * noun 'to' noun                 -> Transfer;
  242. Verb 'turn' 'rotate' 'twist' 'unscrew' 'screw'
  243.                 * noun                           -> Turn
  244.                 * noun 'on'                      -> Switchon
  245.                 * noun 'off'                     -> Switchoff
  246.                 * 'on' noun                      -> Switchon
  247.                 * 'off' noun                     -> Switchoff;
  248. Verb 'switch'
  249.                 * noun                           -> Switchon
  250.                 * noun 'on'                      -> Switchon
  251.                 * noun 'off'                     -> Switchoff
  252.                 * 'on' noun                      -> Switchon
  253.                 * 'off' noun                     -> Switchoff;
  254. Verb 'lock'
  255.                 * noun 'with' held               -> Lock;
  256. Verb 'unlock'
  257.                 * noun 'with' held               -> Unlock;
  258. Verb 'attack' 'break' 'smash' 'hit' 'fight' 'wreck' 'crack'
  259.      'destroy' 'murder' 'kill' 'torture' 'punch' 'thump'
  260.                 * noun                           -> Attack;
  261. Verb 'wait' 'z//'
  262.                 *                                -> Wait;
  263. Verb 'answer' 'say' 'shout' 'speak'
  264.                 * topic 'to' creature            -> Answer;
  265. Verb 'tell'
  266.                 * creature 'about' topic         -> Tell;
  267. Verb 'ask'
  268.                 * creature 'about' topic         -> Ask
  269.                 * creature 'for' noun            -> AskFor;
  270. Verb 'eat'
  271.                 * held                           -> Eat;
  272. Verb 'sleep' 'nap'
  273.                 *                                -> Sleep;
  274. Verb 'peel'
  275.                 * noun                           -> Take
  276.                 * 'off' noun                     -> Take;
  277. Verb 'sing'
  278.                 *                                -> Sing;
  279. Verb 'climb' 'scale'
  280.                 * noun                           -> Climb
  281.                 * 'up'/'over' noun               -> Climb;
  282. Verb 'buy' 'purchase'
  283.                 * noun                           -> Buy;
  284. Verb 'squeeze' 'squash'
  285.                 * noun                           -> Squeeze;
  286. Verb 'swim' 'dive'
  287.                 *                                -> Swim;
  288. Verb 'swing'
  289.                 * noun                           -> Swing
  290.                 * 'on' noun                      -> Swing;
  291. Verb 'blow'
  292.                 * held                           -> Blow;
  293. Verb 'pray'
  294.                 *                                -> Pray;
  295. Verb 'wake' 'awake' 'awaken'
  296.                 *                                -> Wake
  297.                 * 'up'                           -> Wake
  298.                 * creature                       -> WakeOther
  299.                 * creature 'up'                  -> WakeOther
  300.                 * 'up' creature                  -> WakeOther;
  301. Verb 'kiss' 'embrace' 'hug'
  302.                 * creature                       -> Kiss;
  303. Verb 'think'
  304.                 *                                -> Think;
  305. Verb 'smell' 'sniff'
  306.                 *                                -> Smell
  307.                 * noun                           -> Smell;
  308. Verb 'hear' 'listen'
  309.                 *                                -> Listen
  310.                 * noun                           -> Listen
  311.                 * 'to' noun                      -> Listen;
  312. Verb 'taste'
  313.                 * noun                           -> Taste;
  314. Verb 'touch' 'fondle' 'feel' 'grope'
  315.                 * noun                           -> Touch;
  316. Verb 'rub' 'shine' 'polish' 'sweep' 'clean' 'dust' 'wipe' 'scrub'
  317.                 * noun                           -> Rub;
  318. Verb 'tie' 'attach' 'fasten' 'fix'
  319.                 * noun                           -> Tie
  320.                 * noun 'to' noun                 -> Tie;
  321. Verb 'burn' 'light'
  322.                 * noun                           -> Burn
  323.                 * noun 'with' held               -> Burn;
  324. Verb 'drink' 'swallow' 'sip'
  325.                 * noun                           -> Drink;
  326. Verb 'fill'
  327.                 * noun                           -> Fill;
  328. Verb 'cut' 'slice' 'prune' 'chop'
  329.                 * noun                           -> Cut;
  330. Verb 'jump' 'skip' 'hop'
  331.                 *                                -> Jump
  332.                 * 'over' noun                    -> JumpOver;
  333. Verb 'dig'      * noun                           -> Dig
  334.                 * noun 'with' held               -> Dig;
  335. ! ----------------------------------------------------------------------------
  336. !  This routine is no longer used here, but provided to help existing games
  337. !  which use it as a general parsing routine:
  338.  
  339. [ ConTopic w; consult_from = wn;
  340.   do w=NextWordStopped();
  341.   until (w==-1 || (w=='to' && action_to_be==##Answer));
  342.   wn--;
  343.   consult_words = wn-consult_from;
  344.   if (consult_words==0) return -1;
  345.   if (action_to_be==##Ask or ##Answer or ##Tell)
  346.   {   w=wn; wn=consult_from; parsed_number=NextWord();
  347.       if (parsed_number=='the' && consult_words>1) parsed_number=NextWord();
  348.       wn=w; return 1;
  349.   }
  350.   return 0;
  351. ];
  352. ! ----------------------------------------------------------------------------
  353. !  Final task: provide trivial routines if the user hasn't already:
  354. ! ----------------------------------------------------------------------------
  355. #Stub TimePasses      0;
  356. #Stub Amusing         0;
  357. #Stub DeathMessage    0;
  358. #Stub DarkToDark      0;
  359. #Stub NewRoom         0;
  360. #Stub LookRoutine     0;
  361. #Stub AfterLife       0;
  362. #Stub GamePreRoutine  0;
  363. #Stub GamePostRoutine 0;
  364. #Stub AfterPrompt     0;
  365. #Stub BeforeParsing   0;
  366. #Stub PrintTaskName   1;
  367. #Stub InScope         1;
  368. #Stub UnknownVerb     1;
  369. #Stub PrintVerb       1;
  370. #Stub ParserError     1;
  371. #Stub ParseNumber     2;
  372. #Stub ChooseObjects   2;
  373. #IFNDEF PrintRank;
  374. Constant Make__PR;
  375. #ENDIF;
  376. #IFDEF Make__PR;
  377. [ PrintRank; "."; ];
  378. #ENDIF;
  379. #IFNDEF ParseNoun;
  380. Constant Make__PN;
  381. #ENDIF;
  382. #IFDEF Make__PN;
  383. [ ParseNoun obj; obj=obj; return -1; ];
  384. #ENDIF;
  385. #Default Story 0;
  386. #Default Headline 0;
  387. ! ----------------------------------------------------------------------------
  388.